<template>
  <el-dialog
    :model-value="show"
    title="站点资源详情"
    width="800px"
    append-to-body
    :before-close="handleClose"
    :close-on-click-modal="false"
    :close-on-press-escape="false"
    class="form-label-120"
    destroy-on-close
  >
    <DynamicsForm
      ref="DynamicsFormRef"
      form_role="platform"
      :api="resourceDomainAbandonedDetail"
      :params="formParams"
    />
    <template #footer>
      <el-button type="info" @click="handleClose">关闭</el-button>
    </template>
  </el-dialog>
</template>

<script setup>
import DynamicsForm from '@/components/DynamicsForm';
import { resourceDomainAbandonedDetail } from '@/api/history-manage';
const props = defineProps({
  show: {
    type: Boolean,
    default: false
  },
  activeRow: {
    type: Object,
    default: () => {}
  }
});
const emit = defineEmits(['update:show']);

const formParams = computed(() => {
  return { id: props.activeRow.id };
});

// 关闭
function handleClose() {
  emit('update:show', false);
}

// 初始化表单
const DynamicsFormRef = ref();
watch(
  () => props.show,
  async val => {
    if (!val) return;
    await nextTick();
    DynamicsFormRef.value?.initFormList();
  }
);
</script>

<style lang="scss" scoped>
.down-logo-box {
  display: flex;
  align-items: flex-start;
}
.export-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
// :deep(.form-title) {
//   font-weight: 800;
//   font-size: 15px;
//   width: 100%;
//   margin-bottom: 20px;
//   color: var(--el-color-primary-light-1);
//   padding-left: 0;
//   &::before {
//     display: none;
//   }
// }
</style>
